package com.ts.api.module.api.entity.bo;

import com.ts.api.module.match.plan.internal.distribute.model.PlanDistributeField;
import com.ts.api.module.match.plan.internal.distribute.model.PlanDistributeResult;
import com.ts.api.module.product.entity.po.ProductPO;
import com.ts.api.module.product.entity.po.ProductPlanPO;
import lombok.Data;

/**
 *  API撞库业务实体
 *
 *  @author Pan
 */
@Data
public class ApiDataExchangeBO {

    /** 匹配的机构计划信息 */
    private ProductPlanPO productPlanPO;
    /** 匹配的机构信息 */
    private ProductPO productPO;
    /** 分发后返回字段对象 */
    private PlanDistributeField planDistributeField;

    public ApiDataExchangeBO() {
        super();
    }

    /**
     *   构建
     *
     *  @param  planDistributeResult    分发结果对象
     *  @return ApiDataExchangeBO
     */
    public static ApiDataExchangeBO of(PlanDistributeResult planDistributeResult) {
        ApiDataExchangeBO apiDataExchangeBO = new ApiDataExchangeBO();
        apiDataExchangeBO.setProductPO(planDistributeResult.getProductPO());
        apiDataExchangeBO.setProductPlanPO(planDistributeResult.getProductPlanPO());
        apiDataExchangeBO.setPlanDistributeField(planDistributeResult.getPlanDistributeField());
        return apiDataExchangeBO;
    }
}
